<template>
	<view class="content">
		<view class="topBox">
			<view class="setUp"><image src="http://rs.eonfox.cc/clzy/static/setting.png" @click="enterSettingPage" class="gear"></image></view>
			<view class="user">
				<view class="userInfor">
					<image :src="headImg" mode="" class="userImg"></image>
					<text class="userNmae" style="padding-left:220upx; text-align:left; overflow:hidden">{{ userNmae }}</text>
					<view class="collectionBox">
						<view class="userCon">
							<text class="topNum" v-if="Collect">{{ Collect }}</text>
							<text class="topNum" v-if="!Collect">0</text>
							<text class="userContext">收藏</text>
						</view>
						<view class="userCon">
							<text class="topNum">{{ attention }}</text>
							<text class="userContext">关注</text>
						</view>
						<view class="userCon">
							<text class="topNum">{{ footmark }}</text>
							<text class="userContext">足迹</text>
						</view>
						<view class="userCon">
							<text class="topNum">{{ sharenumber }}</text>
							<text class="userContext">已分享</text>
						</view>
					</view>
				</view>
				<image src="http://rs.eonfox.cc/clzy/static/vip(1).png" mode="" class="goldVipImage"></image>
				<text class="goldVip" v-if="is_mch">商家会员</text>
				<text class="goldVip" v-else>消费会员</text>
			</view>
		</view>
		<view class="myOrder">
			
			<view class="orderTitle" @click="enterOrdersPage">
				<text class="orderTitleLeft">我的订单</text>
				<text class="orderTitleRight">查看全部></text>
			</view>
			<view class="orderContentBox" >
				<view class="orderContent" @click="goGroup">
					<image src="http://mp.emshop.eonfox.com/zrhzstatic/emShopImg/groupOrder.png" mode="" class="orderImage"></image>
					<text class="orderText">拼团订单</text>
				</view>
				<view class="orderContent" @click="goPayment(1)">
					<image src="http://rs.eonfox.cc/clzy/static/moneyR.png" mode="" class="orderImage"></image>
					<text class="orderText">待付款</text>
				</view>
				<view class="orderContent" @click="goPayment(2)">
					<image src="http://rs.eonfox.cc/clzy/static/card.png" mode="" class="orderImage"></image>
					<text class="orderText">待发货</text>
				</view>
				<view class="orderContent" @click="goPayment(3)">
					<image src="http://rs.eonfox.cc/clzy/static/giftR.png" mode="" class="orderImage"></image>
					<text class="orderText">待收货</text>
				</view>
				<view class="orderContent" @click="goPayment(4)">
					<image src="http://rs.eonfox.cc/clzy/static/record.png" mode="" class="orderImage"></image>
					<text class="orderText">评价</text>
				</view>
				<!-- <view class="orderContent">
					<image src="http://rs.eonfox.cc/clzy/static/return.png" mode="" class="orderImage"></image>
					<text class="orderText">退换货</text>
				</view> -->
			</view>
		</view>
		<!-- <view class="advertisement"><image src="http://rs.eonfox.cc/clzy/static/raw_1523521108.png" mode="" class="advertisementImage"></image></view> -->
		<view class="myService">
			<!-- <text class="myServiceTitle">我的服务</text>
			<view class="modularTitleBox"><text class="modularTitle">系统上一天分享</text></view> -->
			<!-- <view class="serviceBox">
				<view class="modular">
					<view class="serviceImageBox red"><image src="http://rs.eonfox.cc/clzy/static/msg.png" mode="" class="serviceImage"></image></view>
					<text class="balance">{{ Score_totle / 100 }}</text>
					<text class="balanceName">积分总数</text>
				</view>
				<view class="modular">
					<view class="serviceImageBox yellow"><image src="http://rs.eonfox.cc/clzy/static/extend.png" mode="" class="serviceImage"></image></view>
					<text class="balance">{{ Score_rate }}</text>
					<text class="balanceName">转换率</text>
				</view>
				<view class="modular">
					<view class="serviceImageBox orange"><image src="http://rs.eonfox.cc/clzy/static/extend.png" mode="" class="serviceImage"></image></view>
					<text class="balance">￥{{ Score_money / 100 }}</text>
					<text class="balanceName">共享金</text>
				</view>
			</view> -->
			
			<!-- <view class="modularTitleBox"><text class="modularTitle">资金账户</text></view> -->
			<view class="serviceBox">
				<!-- <view class="modular">
					<view class="serviceImageBox green" @click="my"><image src="http://rs.eonfox.cc/clzy/static/pre.png" mode="" class="serviceImage"></image></view>
					<text class="balance" style="color:#bb4747;">￥{{ Advance / 100 }}</text>
					<text class="balanceName" style="color:#bb4747;">预付款</text>
				</view> -->
				<!-- <view class="modular" @click="publicMoney()">
					<view class="serviceImageBox yellow"><image src="http://rs.eonfox.cc/clzy/static/extend.png" mode="" class="serviceImage"></image></view>
					<text class="balance" style="color:#bb4747;">￥{{ Share / 100 }}</text>
					<text class="balanceName" style="color:#bb4747;">消费共享金</text>
				</view> -->
				<!-- <view class="modular">
					<view class="serviceImageBox yellow"><image src="http://rs.eonfox.cc/clzy/static/authW.png" mode="" class="serviceImage"></image></view>
					<text class="balance">￥{{ Relief / 100 }}</text>
					<text class="balanceName">扶贫资金</text>
				</view> -->
				<!-- <view class="modular" @click="Pension">
					<view class="serviceImageBox purple"><image src="http://rs.eonfox.cc/clzy/static/oldMan.png" mode="" class="serviceImage"></image></view>
					<text class="balance">￥{{ pensionMoney / 100 }}</text>
					<text class="balanceName">养老资金</text>
				</view> -->
				<!-- <view class="modular">
					<view class="serviceImageBox yellow"><image src="http://rs.eonfox.cc/clzy/static/getMW.png" mode="" class="serviceImage"></image></view>
					<text class="balance">￥{{ Serve / 100 }}</text>
					<text class="balanceName">服务费</text>
				</view> -->
				<!-- <view class="modular" @click="present">
					<view class="serviceImageBox red"><image src="http://rs.eonfox.cc/clzy/static/RATE.png" mode="" class="serviceImage"></image></view>
					<text class="balance" style="color:#bb4747;">￥{{ SOfar / 100 }}</text>
					<text class="balanceName" style="color:#bb4747;">赠送收益</text>
				</view> -->
			</view>
			<view style="width: 100%; height: 60upx; background-color: #f3f3f3;">
				
			</view>
			<view class="service">
				我的服务
			</view>
			<view class="sginInBox">
				<view class="sginInCon"  @click="my">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/wallet.png" mode="" class="sginInImage"></image>
					</view>					
					<text>我的钱包</text>
				</view>
				<view class="sginInCon" @click="signIn">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/signin.png" mode="" class="sginInImage"></image>
					</view>					
					<text>{{ SignSuccessfully }}</text>
				</view>
				<view class="sginInCon" @click="MerchantCollection()">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/receivables.png" mode="" class="sginInImage"></image>
					</view>
					
					<text>商家收款</text>
					<!--  -->
				</view>
				<!-- 认证 -->
				<view class="sginInCon" @click="auth()">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/authentication.png" mode="" class="sginInImage"></image>
					</view>
					
					<text>{{ authTxt }}</text>
				</view>
				<view class="sginInCon" @click="popularize()">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/share2.png" mode="" class="sginInImage"></image>
					</view>
					
					<text>我的分享</text>
				</view>
				<view class="sginInCon" @click="goOrder">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/order.png" mode="" class="sginInImage"></image>
					</view>
					
					<text>线下订单</text>
				</view>
				<view class="sginInCon" @click="goPageType(0)">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/shop.png" mode="" class="sginInImage"></image>
					</view>					
					<text>申请成为商家</text>
				</view>
				<!-- <view class="sginInCon" @click="goPageType(1)">
					<view class="img-b">
						<image src="http://muyingshop.eonfox.com/icon/shop.png" mode="" class="sginInImage"></image>
					</view>					
					<text>申请店铺</text>
				</view> -->
			</view>
		</view>
		<view class="brandDynamics" style="display:none">
			<view class="brandTitle">
				<image src="http://rs.eonfox.cc/clzy/static/方点.png" class="brandTitleImage"></image>
				<text>品牌动态</text>
				<image src="http://rs.eonfox.cc/clzy/static/方点.png" class="brandTitleImage"></image>
			</view>
			<view class="brandBox">
				<view class="brandCon">
					<image src="http://rs.eonfox.cc/clzy/static/f27da758a86543d7.jpg" class="brandLeftImage"></image>
					<text class="brandName">Aptamil</text>
					<text class="promotion">促销</text>
				</view>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
			</view>
			<view class="brandBox">
				<view class="brandCon">
					<image src="http://rs.eonfox.cc/clzy/static/f27da758a86543d7.jpg" class="brandLeftImage"></image>
					<text class="brandName">Aptamil</text>
					<text class="promotion">促销</text>
				</view>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
				<image src="http://rs.eonfox.cc/clzy/static/raw_1522116070.png" mode="" class="brandImage"></image>
			</view>
			<view class="more"><text>更多感兴趣的品牌动态 ></text></view>
		</view>
		<view class="popup" v-show="showPopup">
			<view class="close" @click="colose">
				<text style="width: 40%; text-align: left;margin-left: 2%;">请选择操作类型:</text>
			 <text style="width: 56%; text-align: right;">关闭</text>
			 </view>
			<view class="list" v-show="showone" @click="goMerchantCollection"> <text>管理收银员</text> <text style="color: #888888; margin-left: 8upx;">点击进入</text> </view>
			<view class="list" v-show="showtwo" @click="goGatheringCode">商家收款码  <text style="color: #888888; margin-left: 8upx;">点击进入</text></view>
			<view class="list" v-show="showthree" @click="goCashier">收银员收款  <text style="color: #888888; margin-left: 8upx;">点击进入</text> </view>
		</view>
	</view>
</template>

<script>
import eonfox from '@/components/eonfox/eonfox.js';
import uniIcon from '@/components/uni-icon/uni-icon.vue';
import fns from '@/components/eonfox/fns.js';
var ef = new eonfox();
export default {
	data() {
		return {
			userNmae: '未设置',
			inventory_integral: 0,
			is_mch: false,
			pensionMoney: '0.00',
			SOfar: '0.00',
			Advance: '0.00 ',
			Relief: '0.00',
			Serve: '0.00',
			Share: '0.00',
			Score_money: 0,
			Score_rate: 0,
			Score_totle: 0,
			headImg: '../../static/user.png',
			userInfo: [],
			shopsId: '',
			Balance: 0,
			Consume: 0,
			checkin: false,
			SignSuccessfully: '已签到',
			address: '',
			imageID: '',
			sharenumber: 0, //分享人数
			isAuth: false, //是否认证
			authTxt: '认证',
			Business: false, //是否是商家
			CertificateStatus: 0,
			time: '',
			Collect: 0, //收藏
			attention: 0, //关注
			footmark: 0,
			variateone:'', //是商家还是收银员
			variateTwo:'',
			showPopup: false, //显示弹窗
			showone: '',
			showtwo: '',
			showthree: ''
		};
	},
	onShow: function() {
		var _this = this;
		_this.variateone = ''
		_this.variateTwo = ''
		console.log('onshow');
		_this.showPopup=false
		this.load();
	},
	onLoad:function(){
		// #ifdef H5
		// this.getuserToken()
		// #endif
	},

	components: {
		uniIcon,
		eonfox
	},
	methods: {
		goPageType(type){
			if(type==0){//申请成为商家
				uni.navigateTo({
					url:'../../pagesA/applyBusiness/applyBusiness'
				})
			}
			if(type==1){//申请店铺	
				uni.navigateTo({
					url:'../../pagesA/applyStore/applyStore'
				})
			}
		},
		
		goto(page, val) {
			uni.navigateTo({
				url: '../../' + page + '?' + val
			});
		},
		enterSettingPage() {
			uni.navigateTo({
				url: '../../pagesA/setting/setting'
			});
		},
		enterIntegral() {
			uni.navigateTo({
				url: '../../pagesA/integral/integral'
			});
		},
		enterOrdersPage() {
			uni.navigateTo({
				url: '../../pagesB/my-order/my-order'
			});
		},
		popularize() {
			uni.navigateTo({
				url: '../popularize/popularize'
			});
		},
		publicMoney() {
			uni.navigateTo({
				url: '../../pagesA/publicMoney/publicMoney'
			});
		},
		my() {
			uni.navigateTo({
				url: '../../pagesB/account/account'
			});
		},
		signIn() {
			var that = this;
			if (that.checkin == false) {
				that.SignSuccessfully = '已签到';
				uni.showToast({
					title: '今日已签到',
					icon: 'none'
				});
			} else if (that.checkin == true) {
				ef.submit({
					request: {
						qd: ['APPLICATIONORDERSELFDAILYATTENDANCEEARNUSERCREDIT'],
						config: ['APPLICATIONCONFIG']
					},
					callback: function(data) {
						console.log(data);
						var listData = fns.checkError(data, 'qd', function(errno, error) {
							uni.showToast({
								title: error,
								icon: 'none'
							});
						});
						if (listData) {
							if (listData.config && listData.config.daily_attendance_earn_user_credit && listData.config.daily_attendance_earn_user_credit.credit) {
								var showToastTitle = '签到成功，积分+' + parseInt(listData.config.daily_attendance_earn_user_credit.credit) / 100;
							} else {
								var showToastTitle = '签到成功';
							}

							uni.showToast({
								title: showToastTitle,
								icon: 'none',
								success() {
									that.checkin = false;
									that.SignSuccessfully = '已签到';
								}
							});
						}

						that.load();
					},
					error: function(err) {
						console.log('出错啦', err);
					}
				});
			}
		},
		Pension() {
			uni.navigateTo({
				url: '../Pension/Pension'
			});
		},
		present() {
			uni.navigateTo({
				url: '../../pagesB/profit/profit'
			});
		},
		auth() {
			// 				if (this.isAuth) {
			// 					uni.showToast({
			// 						title:'已认证',
			// 						icon:'none'
			// 					})
			// 				} else{
			// 					uni.navigateTo({
			// 					url:'../cash-certification/cash-certification'
			// 				})
			// 				}
			// 0未通过审核，1通过审核，2待审核，3编辑中
			var that = this;
			switch (that.CertificateStatus) {
				case 0:
					uni.navigateTo({
						url: '../../pagesB/cash-certification/cash-certification'
					});
					break;
				case 1:
					uni.showToast({
						title: '已认证' + that.time,
						icon: 'none',
						duration: 3000
					});
					break;
				case 2:
					uni.showToast({
						title: '认证中，待审核',
						icon: 'none'
					});
					break;
				case 3:
					uni.navigateTo({
						url: '../../pagesB/cash-certification/cash-certification'
					});
					break;
				default:
					uni.navigateTo({
						url: '../../pagesB/cash-certification/cash-certification'
					});
					break;
			}
		},
		colose() {
			this.showPopup = false;
		},
		//管理收银员
		goMerchantCollection(){
			uni.navigateTo({
				url: '../../pagesB/MerchantCollection/MerchantCollection'
			});
		},
		//商家收款码
		goGatheringCode(){
			uni.navigateTo({
				url:'../../pagesB/gatheringCode/gatheringCode'
			})
		},
		goGroup() {
			//待付款
			uni.navigateTo({
				url: '../../pagesA/assembleOrder/assembleOrder'
			});
		},
		//收银员收款码
		goCashier(){
			uni.navigateTo({
				url:'../../pagesB/cashier/cashier'
			})
		},
		MerchantCollection() {
			var that = this;
			that.showPopup = true;

			if (that.variateTwo == '管理收银' && that.variateone == '我是收银') {
				that.showone = true;
				that.showtwo = true;
				that.showthree = true;
			} else if (that.variateTwo == '管理收银') {
				that.showone = true;
				that.showtwo = true;
				that.showthree = false;
			} else if (that.variateone == '我是收银') {
				that.showone = false;
				that.showtwo = false;
				that.showthree = true;
			} else {
				that.showPopup=false
				uni.showToast({
					title: '你不是商家',
					icon: 'none'
				});
			}

			// 			if (that.variate == "管理收银") {
			// 				uni.navigateTo({
			// 					url: '../../pagesB/MerchantCollection/MerchantCollection'
			// 				});
			// 			}
			//
			// 			else  if(that.variate=="我是收银"){
			// 					uni.navigateTo({
			// 						url:'../../pagesB/cashier/cashier'
			// 					})
			// 				}
			// 			else  {
			// 						uni.showToast({
			// 							title: '你不是商家',
			// 							icon: 'none'
			// 						});
			// 				}
			//
			//
		},
		load() {
			var _this = this;
			uni.showLoading({
				title: '正在加载'
			});
			ef.submit({
				request: {
					s: ['USERSELF'],
					sj: ['MERCHANTSELF'], //商家数据检测
					p: ['USERPHONESELFVERIFY'],
					consume: ['USERSELFCREDITTOTAL'],
					// Pension: ['USERMONEYSELFANNUITY'],
					// sofar: ['USERMONEYSELFEARNING'],
					advance: ['USERMONEYSELFTOTAL'],
					relief: ['USERMONEYSELFHELP'],
					// serve: ['USERMONEYSELFSERVICE'],
					// share: ['USERMONEYSELFSHARE'],
					total: ['USERCREDITTOTAL'], //积分总和
					system: ['PROJECTCLZYSYSTEMCONVERSIONUSERMONEYSHAREPLUSSUM'], //共享金和
					zhl: ['PROJECTCLZYCONVERSIONRATIO'], //转换率
					residue: ['MERCHANTCREDITSELF'],
					balance: ['MERCHANTMONEYSELF'],
					sigin: ['APPLICATIONORDERSELFDAILYATTENDANCEEARNUSERCREDITEXIST'],
					config: ['APPLICATIONCONFIG'],
					sharenumber: ['USERSELFSONCOUNT'],
					isAuth: ['USERIDENTITYSELFVERIFYCHECK'],
					Authentication: ['USERIDENTITYSELFSTATE'],
					Attention: ['USERFOLLOWSELFCOUNT'], //module  [str] [可选] [关注的模块]
					collect: ['USERCOLLECTIONSELFCOUNT'], //收藏
					cashier: ['MERCHANTCASHIERSELF'] //收银员
				},
				callback: function(data) {
					uni.hideLoading();
					var dataList = fns.checkError(data, ['s', 'p'], function(errno, error) {
						uni.showToast({
							title:'没有登陆',
							icon:"none"
						})
						setTimeout(function(){
							uni.reLaunch({
								url: '../../pagesA/register/register'
							});
						},2000)
						// #ifdef H5
						uni.reLaunch({
							url: '../../pagesA/register/register'
						});
						// #endif
						// #ifndef H5
						// uni.reLaunch({
						// 	url: '../../pagesA/threelogin/threelogin'
						// });
						// #endif
					});

					console.log('信息', data);
					if (!dataList) return false;
					if (!dataList.p[0]) {
						ef.submit({
							request: { s: ['USERLOGOUT'] },
							callback: function(data) {},
							error: function(err) {
								console.log('出错啦', err);
							}
						});
					}
					//关注
					_this.attention = data.data.Attention.data;
					//收藏
					_this.Collect = data.data.collect.data;
					//七牛云
					if (dataList.config && dataList.config.qiniu_domain) {
						_this.address = dataList.config.qiniu_domain;
					}
					console.log('商家数据检测：', dataList);
					if (dataList.sj && dataList.sj.length) {
						_this.is_mch = true;
						_this.shopsId = dataList.sj[0].id;
						//库存积分
					}
					//

					_this.inventory_integral = dataList.residue;
					console.log('库存积分', _this.inventory_integral);

					_this.Balance = dataList.balance;

					//养老金

					// _this.pensionMoney = dataList.Pension;

					//是否认证isAuth

					if (dataList.isAuth) {
						_this.isAuth = true;
						_this.authTxt = '已认证';
					}
					//分享人数

					_this.sharenumber = dataList.sharenumber;

					//收益金额

					// _this.SOfar = dataList.sofar;

					console.log('用户积分', dataList.consume);

					_this.Consume = dataList.consume; //消费积分

					//预付款

					_this.Advance = dataList.advance;

					//扶贫资金

					// _this.Relief = dataList.relief;

					//服务费

					// _this.Serve = dataList.serve;

					//共享金

					// _this.Share = dataList.share;

					//系统上一天分享

					_this.Score_money = dataList.system;

					// _this.Score_rate=dataList.system.score_rate;

					//积分总数

					_this.Score_totle = dataList.total;

					//转化率

					_this.Score_rate = dataList.zhl;

					//签到
					if (data.data.sigin.errno == 1) {
						//未签到
						_this.SignSuccessfully = '签到';
						_this.checkin = true;
					}
					if (!data.data.sigin.errno) {
						//未签到
						_this.SignSuccessfully = '已签到';
						_this.checkin = false;
					}
					//头像

					if (dataList.s.user_logo_image_id != '') {
						_this.imageID = dataList.s.user_logo_image_id;
						_this.headImg =  _this.address+_this.imageID + '?imageView2/1/w/160';
					} else if (dataList.s.user_logo_image_id == '') {
						_this.headImg = '../../static/user.png';
					}
					//昵称
					if (dataList.s.user_nickname) {
						_this.userNmae = dataList.s.user_nickname;
					} else if (dataList.p[0].user_phone_id) {
						_this.userNmae = dataList.p[0].user_phone_id;
						if (!dataList.p[0].user_phone_id) {
							uni.reLaunch({
								url: '../../pagesA/threelogin/threelogin'
							});
						}
					}
					//认证
					if (dataList.Authentication == 0) {
						_this.CertificateStatus = 0;
						console.log('审核状态', _this.CertificateStatus);
					}
					if (dataList.Authentication == 1) {
						_this.CertificateStatus = 1;
						console.log('审核状态', _this.CertificateStatus);
						if (parseInt(dataList.config.user_identity.expire_state)) {
							var times = dataList.config.user_identity.expire_time / 3600;
							_this.time = ',认证失效时间还有' + times / 24 + '天' + (times % 24) + '小时';
						} else {
							_this.time = '';
						}
						console.log('时间', _this.time);
					}
					if (dataList.Authentication == 2) {
						_this.CertificateStatus = 2;
						console.log('审核状态', _this.CertificateStatus);
					}
					if (dataList.Authentication == 3) {
						_this.CertificateStatus = 3;
						console.log('审核状态', _this.CertificateStatus);
					}
					//是否为收银员
					if (data.data.cashier && data.data.cashier.data  && data.data.cashier.data.merchant_cashier_id) {
						_this.variateone= '我是收银';
					}
					//是否为商家
					if (_this.is_mch == true) {
						_this.variateTwo= '管理收银';
					}
				},
				error: function(err) {
					console.log('出错啦', err);
					uni.showToast({
						title: 'error:' + err,
						icon: 'none'
					});
				}
			});
			let footmark = uni.getStorageSync('footmark');
			this.footmark = footmark.length;
		},
		goPayment(type) {
			//待付款
			uni.navigateTo({
				url: '../../pagesB/my-order/my-order?type=' + type
			});
		},
		goShipments() {
			//代发货
			uni.navigateTo({
				url: '../../pagesB/my-order/my-order?type=' + 2
			});
		},
		goReceiving() {
			//待收货
			uni.navigateTo({
				url: '../../pagesB/my-order/my-order?type=' + 3
			});
		},
		goEvaluate() {
			//评价
			uni.navigateTo({
				url: '../../pagesB/my-order/my-order?type=' + 4
			});
		},
		goGeneralize() {
			//退货
			uni.showToast({
				title: '敬请期待',
				icon: 'none'
			});
		},
		goOrder() {
			//线下订单
			if (this.is_mch == false) {
				uni.showToast({
					title: '你不是商家',
					icon: 'none'
				});
			} else {
				uni.navigateTo({
					url: '../../pagesB/orderDown/orderDown'
				});
			}
		},
		goDeal() {
			uni.navigateTo({
				url: '../../pagesB/Deal/Deal?mch_id=' + this.shopsId
			});
		},
		goConsumptionPoints() {
			uni.navigateTo({
				url: '../../pagesB/ConsumptionPoints/ConsumptionPoints?mch_id=' + this.shopsId
			});
		},
		//h5授权信息
		getuserToken(){
			let that = this;
			// console.log(that.userinfo)
			// return
			// if(){}
			uni.getStorage({
				key:'userinfo',
				success: function (res) {
					console.log(res.data.data.u.data);
					that.userInfo = res.data.data.u.data						
					if(res.data.data.u.data){
						
						
						ef.submit({
							request:{
								token:['SESSIONWEIXINACCESSTOKEN'],
								// userinfo:['USERSELF']
							},
							callback: function(data) {
								let dataToken=fns.checkError(data,'token',function(errno,error){
									uni.showToast({
										title: '请先确认微信授权',
										icon:'none'
									})
								})
								// uni.setStorage({
								// 	key:'weixitoken',
								// 	data:data
								// })
								console.log(dataToken,'123456')
								if(dataToken){
									ef.submit({
											request:{
												savtoken:['USERSELFBINDWEIXIN',
													[	
														'web',
														{unionId:dataToken.token.unionid,access_token:dataToken.token.access_token,openid:dataToken.token.openid}
													]
												],																				
											},
											callback:function(data){
												let savdata=fns.checkError(data,'savtoken',function(errno,error){
													console.log(fns.error)
												})												
												
											}
										})
										
									console.log(dataToken,'有数据')
								}else{
									console.log('location', location.href);									
									//当 ACCESSTOKEN 不存在
									ef.left_token(function(left_token){
										var notify_url = encodeURIComponent(location.href);
										var url = ef.api_server_url+"?"+encodeURI('data=[["SESSIONWEIXINAUTHORIZE",[{"notify_url":"'+notify_url+'"}]]]')+"&token="+left_token;
										console.log(url);
										location.href = url;
									});
									
									
								}								
								
							}
						})
					}
					else{
						uni.showToast({
							title:'您还未登陆，前往登录',
							icon:'none'
						})
						setTimeout(function(){
							// #ifdef H5
									uni.reLaunch({
										url:'../../pages/register/register'
									});
									return
									// #endif
									
						},1500)
					}
					
				}
			})
			
			
		},
	}
};
</script>
<style>
.popup {
	width: 80%;
	background-color: #f1f1f1;
	position: fixed;
	top: 400upx;
	font-size: 28upx;
	left: 10%;
	border-radius: 20upx;
	box-shadow: 0 0 15px #795454;
}
.close {
	width: 98%;
	height: 70upx;
	line-height: 70upx;
	background-color: #d23535;
	text-align: right;
	padding-right: 2%;
	color: #ffffff;
	border-top-right-radius: 20upx;
	border-top-left-radius: 20upx;
	display: flex;
}
.list {
	width: 100%;
	height: 60upx;
	text-align: center;
	margin-top: 20upx;
	margin-bottom: 20upx;
	border-bottom: 2upx #ffffff solid;
	color: #101010;
}
.service{
	width: 90%;
	margin-left: 5%;
	height: 80upx;
	line-height: 80upx;
	border-bottom: #CCCCCC solid 1upx;
	color: #333333;
}
</style>
<style scoped lang="stylus" ref="stylesheet/stylus">
.content
	overflow hidden
	color 333
	.topBox
		background #ff0000
		height 400upx
		.setUp
			text-align right

			.gear
				margin 40upx 10upx
				width 60upx
				height 60upx
				color #fff
			.chatboxes
				margin 40upx 10upx
				width 60upx
				height 60upx
		.user
			margin-top 200upx
			width 90%
			height 380upx
			background #121212
			margin 0 auto
			border-radius 20upx
			position relative
			.userInfor
				background #fff
				border-radius 20upx
				width 100%
				height 300upx
				text-align center
				position relative
				.userImg
					position absolute
					top -50upx
					left 50upx
					width 160upx
					height 160upx
					border-radius 50%
				.userNmae
					display block
					padding 20upx 0
				.collectionBox
					margin-top 80upx
					display flex
					align-items center
					justify-content center// 垂直居中
					flex-direction row
					color #333
					font-size 30upx

					.userCon
						width 25%
						text-align center
						.topNum
							display block
							font-weight 600
							color #6B6B6B 100%
						.userContext
							font-size 25upx
							color #B3B3B3
			.goldVipImage

				width 60upx
				height 60upx
				position absolute
				bottom 20upx
				left 20upx
			.goldVip
				position absolute
				bottom 20upx
				left 80upx
				color #E3D7BF
				font-size 28upx
				font-weight 600
	.myOrder
		width 100%
		height 200upx
		padding-top 200upx
		.orderTitle
			margin 0 40upx
			border-bottom 1upx solid #B3B3B3
			padding-bottom 20upx
			color #333
			font-size 26upx
			.orderTitleRight
				color #B3B3B3
				float right
		.orderContentBox
			display flex
			align-items center
			justify-content center// 垂直居中
			flex-direction row
			padding 20upx 0
			.orderContent
				text-align center
				width 24%
				font-size 25upx
				.orderImage
					margin 5upx auto
					display block
					width 50upx
					height 50upx
				.orderText
					color #5C5C5C 100%
					font-weight 500
	.advertisement
		width 100%
		height 150upx
		.advertisementImage
			width 100%
			height 100%
	.myService
		font-size 28upx
		.myServiceTitle
			display block
			margin-left 40upx
			margin-top 50upx
			margin-bottom 20upx
			font-weight 600
			font-size 30upx
		.modularTitleBox
			border-bottom 1upx solid #d3d3d3
			border-top 1upx solid #d3d3d3
			.modularTitle
				padding 5upx 0
				display block
				margin-left 40upx
				font-weight 600
				width 100%
				color #AE9999
		.serviceBox
			width 100%
			// margin 40upx 0
			display flex
			align-items center
			justify-content center
			flex-direction row
			flex-wrap wrap
			.modular
				width 33%
				height 100%
				margin 40upx 0
				display inline-block
				display flex
				align-items center
				flex-direction column
				.serviceImageBox
					width 80upx
					height 80upx
					border-radius 50%
					display flex
					align-items center
					justify-content center
					.serviceImage
						width 50upx
						height 50upx
				.purple
					background #A589E0
				.orange
					background #F1A161
				.yellow
					background #EDD764
				.red
					background #F25422
				.green
					background #A6C979
				.balance
					display block
				.balanceName
					color #BBBBBB
		.sginInBox
			width calc(100% - 60upx)
			// height 170upx
			padding 20upx 30upx
			border-bottom 1upx solid #d3d3d3
			display flex
			align-items center
			text-align center
			flex-wrap wrap
			font-size 28upx
			.sginInCon
				width 25%				
				font-size 28upx
				padding-bottom 30upx
				.img-b
					width 100%
					text-align center
					.sginInImage
						// padding-bottom 16upx
						width 50upx
						height 50upx
	.brandDynamics
		font-size 28upx
		padding 0 40upx
		.brandTitle
			margin-top 50upx
			padding-bottom 20upx
			text-align center
			width 100%
			font-size 30upx
			font-weight 600
			border-bottom 1px solid #d3d3d3
			.brandTitleImage
				width 20upx
				height 20upx
		.brandBox
			width 100%
			height 250upx
			display flex
			align-items center
			justify-content center
			flex-direction row
			border-bottom 1px solid #d3d3d3
			.brandCon
				height 100%
				width 25%
				display flex
				align-items center
				justify-content center
				flex-direction column
				.brandLeftImage
					box-sizing: border-box
					height 100upx
					width 100upx
					border 1upx solid #E3E3E3
				.brandName
					font-size 28upx
					font-weight 550
					display block
				.promotion
					display block
					padding 0 8upx
					border-radius 20upx
					color #d62f2f
					border 1upx solid #d62f2f
			.brandImage
				width 150upx
				height 200upx
		.more
			text-align center
			color #999999
			margin-top 30upx
			margin-bottom 20upx
</style>
